<?php
/*
 * @ https://EasyToYou.eu - IonCube v11 Decoder Online
 * @ PHP 7.2 & 7.3
 * @ Decoder version: 1.1.6
 * @ Release: 10/08/2022
 */

// Decoded file for php version 71.
class PHPExcel_CachedObjectStorageFactory
{
    private static $storageMethodParameters = [];
    private static $cacheStorageMethod;
    private static $cacheStorageClass;
    private static $storageMethods = ["Memory", "MemoryGZip", "MemorySerialized", "Igbinary", "PHPTemp", "DiscISAM", "APC", "Memcache", "Wincache", "SQLite", "SQLite3"];
    private static $storageMethodDefaultParameters = ["Memory" => [], "MemoryGZip" => [], "MemorySerialized" => [], "Igbinary" => [], "PHPTemp" => ["memoryCacheSize" => "1MB"], "DiscISAM" => ["dir" => NULL], "APC" => ["cacheTime" => 600], "Memcache" => ["memcacheServer" => "localhost", "memcachePort" => 11211, "cacheTime" => 600], "Wincache" => ["cacheTime" => 600], "SQLite" => [], "SQLite3" => []];
    const cache_in_memory = "Memory";
    const cache_in_memory_gzip = "MemoryGZip";
    const cache_in_memory_serialized = "MemorySerialized";
    const cache_igbinary = "Igbinary";
    const cache_to_discISAM = "DiscISAM";
    const cache_to_apc = "APC";
    const cache_to_memcache = "Memcache";
    const cache_to_phpTemp = "PHPTemp";
    const cache_to_wincache = "Wincache";
    const cache_to_sqlite = "SQLite";
    const cache_to_sqlite3 = "SQLite3";
    public static function getCacheStorageMethod()
    {
        return self::$cacheStorageMethod;
    }
    public static function getCacheStorageClass()
    {
        return self::$cacheStorageClass;
    }
    public static function getAllCacheStorageMethods()
    {
        return self::$storageMethods;
    }
    public static function getCacheStorageMethods()
    {
        $activeMethods = [];
        foreach (self::$storageMethods as $storageMethod) {
            $cacheStorageClass = "PHPExcel_CachedObjectStorage_" . $storageMethod;
            if(call_user_func([$cacheStorageClass, "cacheMethodIsAvailable"])) {
                $activeMethods[] = $storageMethod;
            }
        }
        return $activeMethods;
    }
    public static function initialize($method = self::cache_in_memory, $arguments = [])
    {
        if(!in_array($method, self::$storageMethods)) {
            return false;
        }
        $cacheStorageClass = "PHPExcel_CachedObjectStorage_" . $method;
        if(!call_user_func([$cacheStorageClass, "cacheMethodIsAvailable"])) {
            return false;
        }
        self::$storageMethodParameters[$method] = self::$storageMethodDefaultParameters[$method];
        foreach ($arguments as $k => $v) {
            if(array_key_exists($k, self::$storageMethodParameters[$method])) {
                self::$storageMethodParameters[$method][$k] = $v;
            }
        }
        if(self::$cacheStorageMethod === NULL) {
            self::$cacheStorageClass = "PHPExcel_CachedObjectStorage_" . $method;
            self::$cacheStorageMethod = $method;
        }
        return true;
    }
    public static function getInstance(PHPExcel_Worksheet $parent)
    {
        $cacheMethodIsAvailable = true;
        if(self::$cacheStorageMethod === NULL) {
            $cacheMethodIsAvailable = self::initialize();
        }
        if($cacheMethodIsAvailable) {
            $instance = new self::$cacheStorageClass($parent, self::$storageMethodParameters[self::$cacheStorageMethod]);
            if($instance !== NULL) {
                return $instance;
            }
        }
        return false;
    }
    public static function finalize()
    {
        self::$cacheStorageMethod = NULL;
        self::$cacheStorageClass = NULL;
        self::$storageMethodParameters = [];
    }
}

?>